1. Field of the Invention
The present invention relates to a microcomputer performing arithmetic processing (operating) based on AD (analog-to-digital) converted digital values.
2. Description of Related Art
FIG. 6 is a block diagram showing a conventional microcomputer. In the figure, the reference numeral 1 designates an AD converting circuit which converts analog input signals to digital signals based on a certain sampling cycle; 2 designates an operating circuit which performs arithmetic processing based on the digital values; 3 designates an integrating circuit which integrates the digital values input from the AD converting circuit 1; 4 designates a differentiating circuit which differentiates the integrated digital values; 5 designates an equalizing circuit which equalizes the differentiated digital values to obtain a slice level; 6 designates a judging circuit which judges the differentiated digital values based on the slice level to output binary data.
Next, the operation of the conventional microcomputer will be described.
The AD converting circuit 1 performs a sampling operation of analog input signals based on a certain sampling cycle and quantizes them to directly output the quantized digital values to the operating circuit 2.
In the operating circuit 2, the integrating circuit 3 integrates the digital values and the differentiating circuit 4 then differentiates the integrated digital values. The equalizing circuit 5 equalizes the differentiated digital values to obtain a slice level and the judging circuit 6 compares and judges the digital values differentiated by the differentiating circuit 4 based on the slice level to output binary data, xe2x80x9c0xe2x80x9d and xe2x80x9c1xe2x80x9d. The operation result by the operating circuit 2 is output to the later circuits of the microcomputer.
Since the conventional microcomputer is thus constructed, there is a subject that in cases where analog input signals supplied to the AD converting circuit 1 contains noise components such as an overshoot and an undershoot, digital values quantized by the AD converting circuit 1 contains irregular signal waveforms and a slice level determined by the equalizing circuit 5 changes, resulting in the occurrence of an error in binary data provided by the judging circuit 6.
The present invention is implemented to solve the above subject involved in the conventional microcomputer. An object of the present invention is to provide a microcomputer capable of outputting reliable operation results by removing irregular signal waveforms.
According to an aspect of the present invention, there is provided a microcomputer comprising; an AD converting circuit for AD converting analog input signals based on a certain sampling cycle; an upper clip circuit for comparing digital values output from the AD converting circuit with a high level reference value, and replacing a digital value larger than the high level reference value with the high level reference value; a lower clip circuit for comparing digital values output from the upper clip circuit with a low level reference value, and replacing a digital value smaller than the low level reference value with the low level reference value; and an operating circuit for performing arithmetic processing based on digital values output from the lower clip circuit.
Here, the microcomputer may further comprises; an error detecting circuit for detecting an error of an operation result by the operating circuit; and a level reference value operating unit for operating a renewal value of the high level reference value used in the upper clip circuit based on a mean value of digital values output from the AD converting circuit, a maximum value of digital values and the currently set high level reference value, and operating a renewal value of the low level reference value used in the lower clip circuit based on a mean value of digital values output from the AD converting circuit, a minimum value of digital values and the currently set low level reference value, in cases where the error detecting circuit detects an error of an operation result.
As stated above, a microcomputer of the present invention is constructed so as to comprise; an AD converting circuit for AD converting analog input signals based on a certain sampling cycle; an upper clip circuit for comparing digital values output from the AD converting circuit with a high level reference value, and replacing a digital value larger than the high level reference value with the high level reference value; a lower clip circuit for comparing digital values output from the upper clip circuit with a low level reference value, and replacing a digital value smaller than the low level reference value with the low level reference value; and an operating circuit for performing arithmetic processing based on digital values output from the lower clip circuit. Because of the construction, irregular signal waveforms caused by noise components contained in analog input signals can be removed by replacing with the high and low level reference values so that a microcomputer capable of outputting reliable operation results can be provided.
Further, a microcomputer of the present invention is constructed so as to comprise; an error detecting circuit for detecting an error of an operation result by the operating circuit; and a level reference value operating unit for operating a renewal value of the high level reference value used in the upper clip circuit based on a mean value of digital values output from the AD converting circuit, a maximum value of digital values and the currently set high level reference value, and operating a renewal value of the low level reference value used in the lower clip circuit based on a mean value of digital values output from the AD converting circuit, a minimum value of digital values and the currently set low level reference value, in cases where the error detecting circuit detects an error of an operation result. Because of the construction, in cases where the currently set high and low reference values become improper and the error detecting circuit detects an error of operation results, the level reference value operating unit can operate more proper high and low reference values to set them in the upper and lower clip circuits, thereby enhancing the reliability of operation results by the operating circuit.